<template>
  <div class="chooseAddress-content">
    <web-view @message="handleMsg" :src="webViewSrc"></web-view>
  </div>
</template>
<script>
// import { setToken } from "@/utils/auth";
// import { updatePubUserPhone } from "@/service/api/sp-common/user";
import { mapState } from "vuex";

export default {
  props: {
    webViewUrl: String,
  },
  data() {
    return {};
  },
  computed: {
    webViewSrc() {
      return decodeURIComponent(this.webViewUrl);
    },
    // ...mapState("sp-common/auth", ["updatePubUserParams"]),
  },
  methods: {
    handleMsg(e) {
      console.log("监听的回调", e);
      if (e.detail.data[0].token.token) {
        console.log("e.detail.data[0].token", e.detail.data[0].token);
      }
    },
    // async handleUpdatePubUserPhone() {
    //   const res = await updatePubUserPhone({
    //     ...this.updatePubUserParams,
    //   });
    //   if (res.code === 0) {
    //     await this.$store.dispatch("sp-common/user/getUserBaseInfoAction");
    //   }
    // },
  },
};
</script>
<style lang="scss" scoped></style>
